<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="检验列表" libs=["treeTable"]/>
<div class="container-div">
    <!--<div class="row">-->
        <!--<div class="col-sm-12 search-collapse">-->
            <!--<@f.form name="comp-form">-->
            <!--<div class="select-list">-->
                <!--<ul>-->
                    <!--<li>-->
                        <!--<@ctx.i18n text = "公司名称"/>：<@f.input name="name"/>-->
                    <!--</li>-->
                    <!--<li>-->
                        <!--<a class="btn btn-primary btn-rounded btn-sm" onclick="$.treeTable.search()"><i class="fa fa-search"></i>&nbsp;<@ctx.i18n text = "查询"/></a>-->
                        <!--<a class="btn btn-warning btn-rounded btn-sm" onclick="opt.form.reset()"><i class="fa fa-refresh"></i>&nbsp;<@ctx.i18n text = "重置"/></a>-->
                    <!--</li>-->
                <!--</ul>-->
            <!--</div>-->
        <!--</@f.form>-->
    <!--</div>-->
    <@table id="bootstrap-tree-table">
    <@shiro.hasPermission name="bus:test:add">
    <a class="btn btn-success" onclick="opt.operate.add(0)"><i class="fa fa-plus"></i>&nbsp;<@ctx.i18n text = "新增"/></a>
</@shiro.hasPermission>
<@shiro.hasPermission name="bus:test:edit">
<a class="btn btn-primary" onclick="opt.operate.edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;<@ctx.i18n text = "修改"/></a>
</@shiro.hasPermission>
<a class="btn btn-info" id="expandAllBtn">
    <i class="fa fa-exchange"></i> <@ctx.i18n text = "展开/折叠"/>
</a>
</@table>
</div>
</div>
<@footer>
<script type="text/javascript">
    var addFlag = "${permission.hasPermi('bus:test:add')}";
    var editFlag = "${permission.hasPermi('bus:test:edit')}";
    var delFlag = "${permission.hasPermi('bus:test:del')}";
    var datas = ${dict.getDictListJson('sys_normal_disable')};
    var types = ${dict.getDictListJson('sys_comp_type')};
    var visible = ${permission.isPermitteds("sys:comp:edit,sys:comp:del")?string('true', 'false')};
    var prefix = baseURL + "pms/test";

    $(function() {
        var options = {
            code: "id",
            parentCode: "parentId",
            uniqueId: "id",
            url: prefix + "/list",
            addUrl: prefix + "/add/{id}",
            editUrl: prefix + "/edit/{id}",
            delUrl: prefix + "/del/{id}",
            modalName: "分类",
            columns: [
                {field: 'selectItem', radio: true},
                {field: 'testName', title: "<@ctx.i18n text = "标准名称"/>", align: "left",halign:"left"},
                {field: 'id', title: "<@ctx.i18n text = "编码"/>",  },
                {field: 'createTime', title: "<@ctx.i18n text = "创建时间"/>"},
                {title: "<@ctx.i18n text = "操作"/>",visible:visible, formatter: function(value, row, index) {
                        if (row.parentId != 0) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="opt.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit"></i> <@ctx.i18n text = "编辑"/></a> ');
                            actions.push('<a class="btn btn-info  btn-xs ' + addFlag + '" href="javascript:void(0)" onclick="opt.operate.addTab(\'' + row.id + '\')"><i class="fa fa-plus"></i> <@ctx.i18n text = "新增"/></a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + delFlag + '" href="javascript:void(0)" onclick="opt.operate.del(\'' + row.id + '\')"><i class="fa fa-trash"></i> <@ctx.i18n text = "删除"/></a>');
                            return actions.join('');
                        } else {
                            return "";
                        }}
                }]
        };
        $.treeTable.init(options);
    });
</script>
</@footer>
</@pageTheme>